package com.sora.sora.security.login.model.bo.verify;

import java.security.SecureRandom;

public class LetterNumberMixCode implements VerifyCode{

    private final String code = "0123456789abcdefghijklmnqoprstufwxyz";

    @Override
    public int length() {
        return 6;
    }

    @Override
    public String value() {
        SecureRandom secureRandom = new SecureRandom();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i<length(); i++) {
            builder.append(code.charAt(secureRandom.nextInt(code.length())));
        }
        return builder.toString();
    }
}
